home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Controls / Visual Basic Controls.iso / vbcontrol / cstwnd / blocks.h < prev    next >
C/C++ Source or Header  |  1994-01-04  |  2KB  |  74 lines

  1. #ifndef _BLOCKS_H_
  2. #define _BLOCKS_H_
  3.  
  4. #include "custwind.h"
  5.  
  6. _CLASSDEF(TBlockWindows)
  7. class _EXPORT TBlockWindows : virtual public TUnderlying
  8. {
  9. public:
  10.     TBlockWindows(PCustColors SomeColors, PCustCursors
  11.         SomeCursors)
  12.         : TUnderlying(SomeColors, SomeCursors)
  13.         { };
  14.  
  15.    //Only need to draw the frame and title
  16.     virtual void UserFrame(HDC DrawDC);
  17.     virtual void UserTitle(HDC DrawDC);
  18.  
  19.     //I didn't say that the User functions were the only
  20.    //ones that you can redefine
  21.     virtual void UEraseBkGnd(RTMessage Msg);
  22.     virtual void UCtlColor(RTMessage Msg);
  23.  
  24. protected:
  25.     virtual LPSTR GetClassName()
  26.         { return (LPSTR)"BLOCKWINDOW"; };
  27. };
  28.  
  29. /*******************************************************************
  30. The following will create two new classes, one to create
  31. Dialogs and the Other for Windows.  This isn't hard to
  32. do because the major chunk can just be cut from the
  33. CUSTWIND.H header file and change the names.
  34. *******************************************************************/
  35.  
  36. _CLASSDEF(TBlockDialog)
  37. class TBlockDialog : public TCustomDialog,
  38.     public TBlockWindows
  39. {
  40. public:
  41.     TBlockDialog(PTWindowsObject AParent, LPSTR AName,
  42.         PCustColors Colors, PCustCursors Cursors,
  43.         PTModule AModule = NULL)
  44.         : TCustomDialog(AParent, AName, Colors, Cursors,
  45.           AModule) ,
  46.          TBlockWindows(Colors, Cursors),
  47.          TUnderlying(Colors, Cursors) {};
  48.     TBlockDialog(PTWindowsObject AParent, int ResourceId,
  49.         PCustColors Colors, PCustCursors Cursors,
  50.         PTModule AModule = NULL)
  51.         : TBlockWindows(Colors, Cursors),
  52.          TUnderlying(Colors, Cursors),
  53.          TCustomDialog(AParent, ResourceId, Colors, Cursors,
  54.           AModule) { };
  55. };
  56.  
  57. _CLASSDEF(TBlockWindow)
  58. class TBlockWindow : public TCustomWindow,
  59.     public TBlockWindows
  60. {
  61. public:
  62.     TBlockWindow(PTWindowsObject AParent, LPSTR ATitle,
  63.         PCustColors Colors, PCustCursors Cursors,
  64.         PTModule AModule = NULL)
  65.         : TCustomWindow(AParent, ATitle, Colors, Cursors,
  66.             AModule),
  67.         TUnderlying(Colors, Cursors),
  68.         TBlockWindows(Colors, Cursors) {};
  69. };
  70.  
  71.  
  72. #endif //_BLOCKS_H_
  73.  
  74.